<%@ page contentType="text/html" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>.::Metaphor::.</title>
    <link type="text/css" rel="stylesheet" href="<c:url value="/resources/dijit/themes/tundra/tundra.css" />"/>
    <style type="text/css" media="screen">
        @import url( "<c:url value="/assets/layout/tools.css" />" );
        @import url( "<c:url value="/assets/layout/typo.css" />" );
        @import url( "<c:url value="/assets/layout/forms.css" />" );
        @import url( "<c:url value="/assets/layout/layout-navtop-localleft.css" />" );
        @import url( "<c:url value="/assets/layout/layout.css" />" );
        @import url( "<c:url value="/assets/styles/metaphor.css" />" );
    </style>
    <script type="text/javascript" src="<c:url value="/resources/dojo/dojo.js" />"></script>
    <script type="text/javascript" src="<c:url value="/resources/spring/Spring.js" />"></script>
    <script type="text/javascript" src="<c:url value="/resources/spring/Spring-Dojo.js" />"></script>
</head>
<body class="tundra metaphor">
<div id="page" class="metaphor">
    <div id="header" class="clearfix metaphor">
        <div id="welcome">
            <div class="left"><img src="<c:url value="/assets/images/metaphor.png"/>" alt="Metaphor"/></div>
            <div class="right">
                <span style="float:right;padding-right:5px;padding-left:15px">
                <form method="post" action="">
                <div>
                    <label for="search-site">Search</label>
                    <input type="text" name="search-site" id="search-site"/>
                    <input type="submit" value="go" id="search-site-button" name="search-site-button"/>
                </div>
                </form>
                </span>
                <span style="float:right;padding-top:6px">
                <div>
                    <security:authorize ifAllGranted="ROLE_USER">
                        <c:if test="${pageContext.request.userPrincipal != null}">
                            Welcome, ${pageContext.request.userPrincipal.name} |
                        </c:if>
                        <a href="<c:url value="/app/logout" />">Logout</a>
                    </security:authorize>
                    <security:authorize ifAllGranted="ROLE_ANONYMOUS">
                        <a href="<c:url value="/app/login" />">Login</a>
                    </security:authorize>
                </div>
                </span>
            </div>
        </div>
        <!--
        <div id="branding" class="spring">
        <a href="<c:url value="/" />"><img src="<c:url value="/assets/images/header.jpg"/>" alt="Spring Travel" /></a>
        </div>
        -->
    </div>
    <div id="content" class="clearfix metaphor">
        <tiles:insertAttribute name="menu"/>
        <tiles:insertAttribute name="options"/>
        <div id="main" class="metaphor">
            <tiles:insertAttribute name="body"/>
        </div>
    </div>
    <tiles:insertAttribute name="footer"/>
</div>
</body>
</html>